package com.hsgene.authority.service.api;

import com.hsgene.authority.service.api.impl.OperationOrganizationServiceImpl;
import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.support.Pagination;
import com.hsgene.user.dto.orginazation.DepartmentDto;
import com.hsgene.user.dto.orginazation.OrganizationDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 组织管理Controller
 *
 * @author wangbing
 * @version 1.0, 2018/11/2
 */
@FeignClient(name = "ms-mod-user", path = "/v1.0/genetic/testing", fallback = OperationOrganizationServiceImpl.class)
public interface OperationOrganizationService {

    /**
     * 查询组织信息
     *
     * @param orgId   组织id
     * @param orgType 组织类型（position-职位,department-部门,company-公司）
     * @return 组织信息
     */
    @GetMapping("organization/{org_id}")
    ApiResult<OrganizationDto> findOrganization(
            @PathVariable("org_id") String orgId,
            @RequestParam(name = "orgType", defaultValue = "company") String orgType);

    /**
     * 查询公司部门信息
     *
     * @param page           页数
     * @param size           每页数量
     * @param departmentName 部门名称
     * @param companyName    公司名称
     * @return 公司部门信息
     * @description 查询部门信息/部门列表
     * @author maodi
     * @createDate 2018/11/7 9:03
     */
    @GetMapping("departments")
    ApiResult<Pagination<DepartmentDto>> queryDepartment(
            @RequestParam("page") Integer page,
            @RequestParam("size") Integer size,
            @RequestParam(name = "departmentName", required = false) String departmentName,
            @RequestParam(name = "companyName", required = false) String companyName);
}
